{% extends 'base.html' %}

{% block content%}
    <table class="tabl">
    {% if user.is_superuser %}
        <tr><td class="heador"><strong>{{ object.title }}</strong></td>
            <td style="text-align:center;">
                <a href={% url docs_create %}><img src="{{ MEDIA_URL }}/images/add.png"></a>
            </td></tr>
    {% else %}
        <tr><td colspan="2" class="heador"><strong>{{ object.title }}</strong></td></tr>
    {% endif %}
    
    {% for item in object.get_documents %}
       <tr class="{% cycle 'color1' 'color2' %}">

           <td class="one">
           {% if user.is_superuser %}
                <a href={% url docs_update item.id  %}><img style="width:25px;" src="{{ MEDIA_URL }}/images/edit_big.png"></a>
           {% endif %}
           <strong>{{ item.title }}</strong>
           </td>
           <td class="two"><a href="{{ item.doc.url }}"><strong>Скачать</strong></a></td>
       </tr>
    {% empty %}
        <tr><td colspan="2">Документов нет</td></tr>
    {% endfor %}
    </table>
{% endblock %}